package com.gsmr.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gsmr.service.RealTimeMonitoringService;
import com.gsmr.util.Md5Util;
import com.gsmr.util.ResponseUtil;

import net.sf.json.JSONObject;
import net.sf.json.groovy.GJson;

/**
* @author 作者 : 黄志新
* @version 创建时间：2017年8月7日 上午9:56:46
* 类说明：
*/
@Controller
@RequestMapping("/realTimeMonitoring")
public class RealTimeMonitoringController {

	@Resource
	private RealTimeMonitoringService realTimeMonitoringService;
	
	/**
	 * 实时入库监控
	 * @param requset
	 * @param response
	 * @return
	 * @throws Exception
	 */
	@RequestMapping("/getCurrentQuantity")
	public String getCurrentQuantity(HttpServletRequest requset,HttpServletResponse response)throws Exception{
		Map<String, Integer> m = realTimeMonitoringService.getCurrentQuantity();
		JSONObject result=JSONObject.fromObject(m);
		//{"FACCH_CURRENT_QUANTITY":5,"FrequencySpectrum_CURRENT_QUANTITY":0,"SACCH_CURRENT_QUANTITY":7,"SDCCH_CURRENT_QUANTITY":4,"TCH_CURRENT_QUANTITY":0}
		ResponseUtil.write(response, result);
		return null;
	}
	
}
